package com.ltx.text.service.Impl;

import com.ltx.text.exception.CustomizeException;
import com.ltx.text.exception.Exception;
import com.ltx.text.model.User;
import com.ltx.text.service.UserService;

public class UserServiceImpl implements UserService {
    @Override
    public void login(User user) {
        if (user==null && user.equals("")){
            throw new Exception(CustomizeException.USER_EMPTY);
        }
        if (user.getUsername().length() > 3){
            throw new Exception(CustomizeException.USERNAME_ERROR);
        }
        if (user.getPassword().length() <6){
            throw new Exception(CustomizeException.PASSWORD_SHORT);
        }
        System.out.println("登录成功！");
    }
}
